package com.project.service.impl;

import com.project.entity.GeneralManager;
import com.project.entity.SuperAdministrator;
import com.project.entity.User;
import com.project.service.SystemManage;
import com.project.mapper.*;
public class SystemManageService implements SystemManage {
	
	private		com.project.mapper.GeneralManagerMapper	generalManagerMapper;
	private		com.project.mapper.SuperAdministratorMapper	superAdministratorMapper;
	private		com.project.mapper.UserMapper				userMapper;

	/***
	 * 获取普通管理员
	 */
	public GeneralManager getManager(String id) {
		// TODO Auto-generated method stub
		return	this.generalManagerMapper.selectByPrimaryKey(Integer.valueOf(id));
		
	}

	public GeneralManager getManagerByNumber(String number){
		GeneralManager manager;
		try{
			manager = this.generalManagerMapper.getByNumber(number);
		}catch(Exception e){
			manager = null;
		}
		return manager;
	}
	
	/*
	 * 获取超级管理员
	 * (non-Javadoc)
	 * @see com.project.service.SystemManage#getSuper(java.lang.String)
	 */
	public SuperAdministrator getSuper(String id) {
		// TODO Auto-generated method stub
		return	this.superAdministratorMapper.selectByPrimaryKey(Integer.valueOf(id));
	}
	
	public User	getUser(String number){
		return	this.userMapper.getByNumber(number);
	}

	
	
	
	
	
	
	
	

	public com.project.mapper.GeneralManagerMapper getGeneralManagerMapper() {
		return generalManagerMapper;
	}

	public void setGeneralManagerMapper(
			com.project.mapper.GeneralManagerMapper generalManagerMapper) {
		this.generalManagerMapper = generalManagerMapper;
	}

	public com.project.mapper.SuperAdministratorMapper getSuperAdministratorMapper() {
		return superAdministratorMapper;
	}

	public void setSuperAdministratorMapper(
			com.project.mapper.SuperAdministratorMapper superAdministratorMapper) {
		this.superAdministratorMapper = superAdministratorMapper;
	}
	
	public com.project.mapper.UserMapper getUserMapper() {
		return userMapper;
	}

	public void setUserMapper(com.project.mapper.UserMapper userMapper) {
		this.userMapper = userMapper;
	}


	
}
